<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>PinCRT: Threads</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">PinCRT
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Threads</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gab71e33264cb5f3aebcd8fffd2d475e50"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#gab71e33264cb5f3aebcd8fffd2d475e50">OS_CreateThread</a> (VOID(*ThreadMainFunction)(VOID *), VOID *ThreadParam, VOID *stackBottom, ADDRINT stackSize, <a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a> *td)</td></tr>
<tr class="separator:gab71e33264cb5f3aebcd8fffd2d475e50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9a9056405b34b3cd723b6e6bc1366a61"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#ga9a9056405b34b3cd723b6e6bc1366a61">OS_ExitThread</a> (<a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a> td)</td></tr>
<tr class="separator:ga9a9056405b34b3cd723b6e6bc1366a61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga51d3a3f045f7d12077b92f49274844b9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#ga51d3a3f045f7d12077b92f49274844b9">OS_ThreadExitAndClear</a> (void *stackAddr, ADDRINT stackSize, INT32 *dwordToReset)</td></tr>
<tr class="separator:ga51d3a3f045f7d12077b92f49274844b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa87c77702ceb0356089d8478bd630c55"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#gaa87c77702ceb0356089d8478bd630c55">OS_SuspendThread</a> (<a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a> td)</td></tr>
<tr class="separator:gaa87c77702ceb0356089d8478bd630c55"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0263cb6e9d2ed19869dd3b94d17216af"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#ga0263cb6e9d2ed19869dd3b94d17216af">OS_ResumeThread</a> (<a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a> td)</td></tr>
<tr class="separator:ga0263cb6e9d2ed19869dd3b94d17216af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabfa997efc82ef1205a64f76a8928aa28"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#gabfa997efc82ef1205a64f76a8928aa28">OS_Sleep</a> (INT interval)</td></tr>
<tr class="separator:gabfa997efc82ef1205a64f76a8928aa28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga840329607e681a7ba8ebb941fc5745c5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#ga840329607e681a7ba8ebb941fc5745c5">OS_GetTid</a> (<a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a> *id)</td></tr>
<tr class="separator:ga840329607e681a7ba8ebb941fc5745c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4e1358f36d98dff7b62de2f410439787"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#ga4e1358f36d98dff7b62de2f410439787">OS_Yield</a> (void)</td></tr>
<tr class="separator:ga4e1358f36d98dff7b62de2f410439787"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad5802f57eff3b0b5aabcc1e0b15147d0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__OS__APIS__THREAD.html#gad5802f57eff3b0b5aabcc1e0b15147d0">OS_RaiseException</a> (<a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a> td, UINT32 code)</td></tr>
<tr class="separator:gad5802f57eff3b0b5aabcc1e0b15147d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Contains thread-related os apis </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab71e33264cb5f3aebcd8fffd2d475e50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab71e33264cb5f3aebcd8fffd2d475e50">&#9670;&nbsp;</a></span>OS_CreateThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_CreateThread </td>
          <td>(</td>
          <td class="paramtype">VOID(*)(VOID *)&#160;</td>
          <td class="paramname"><em>ThreadMainFunction</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VOID *&#160;</td>
          <td class="paramname"><em>ThreadParam</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">VOID *&#160;</td>
          <td class="paramname"><em>stackBottom</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ADDRINT&#160;</td>
          <td class="paramname"><em>stackSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a> *&#160;</td>
          <td class="paramname"><em>td</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Create a new thread in the current process.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ThreadMainFunction</td><td>Thread start address </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">ThreadParam</td><td>Thread optional parameter </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">stackBottom</td><td>The base address of the thread's stack. This argument can be NULL. In that case this function will allocate the stack according to the <b>stackSize</b> argument. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">stackSize</td><td>The size of the thread's stack. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">td</td><td>The descriptor of newly created thread.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_NO_ERROR</td><td>If the operation succeeded </td></tr>
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_CREATE_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Windows, Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga9a9056405b34b3cd723b6e6bc1366a61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9a9056405b34b3cd723b6e6bc1366a61">&#9670;&nbsp;</a></span>OS_ExitThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_ExitThread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a>&#160;</td>
          <td class="paramname"><em>td</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Causes a running thread to exit.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">td</td><td>Thread descriptor</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_NO_ERROR</td><td>If the operation succeeded </td></tr>
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_EXIT_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Windows, Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga840329607e681a7ba8ebb941fc5745c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga840329607e681a7ba8ebb941fc5745c5">&#9670;&nbsp;</a></span>OS_GetTid()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_GetTid </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a> *&#160;</td>
          <td class="paramname"><em>id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Retrieves the current thread's handle.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">id</td><td>Address of handle container variable</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_NO_ERROR</td><td>If the operation succeeded </td></tr>
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_QUERY_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Windows, Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="gad5802f57eff3b0b5aabcc1e0b15147d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad5802f57eff3b0b5aabcc1e0b15147d0">&#9670;&nbsp;</a></span>OS_RaiseException()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_RaiseException </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a>&#160;</td>
          <td class="paramname"><em>td</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">UINT32&#160;</td>
          <td class="paramname"><em>code</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Raise an exception.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">td</td><td>Thread descriptor </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">code</td><td>Exception type</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_NO_ERROR</td><td>If the operation succeeded </td></tr>
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_SLEEP_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Windows, Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga0263cb6e9d2ed19869dd3b94d17216af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0263cb6e9d2ed19869dd3b94d17216af">&#9670;&nbsp;</a></span>OS_ResumeThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_ResumeThread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a>&#160;</td>
          <td class="paramname"><em>td</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Resumes running thread.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">td</td><td>Thread descriptor</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_NO_ERROR</td><td>If the operation succeeded </td></tr>
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_RESUME_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Windows, Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="gabfa997efc82ef1205a64f76a8928aa28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabfa997efc82ef1205a64f76a8928aa28">&#9670;&nbsp;</a></span>OS_Sleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_Sleep </td>
          <td>(</td>
          <td class="paramtype">INT&#160;</td>
          <td class="paramname"><em>interval</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sends thread to sleep.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">interval</td><td>Interval to sleep in milli-seconds.</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_NO_ERROR</td><td>If the operation succeeded </td></tr>
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_SLEEP_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Windows, Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="gaa87c77702ceb0356089d8478bd630c55"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa87c77702ceb0356089d8478bd630c55">&#9670;&nbsp;</a></span>OS_SuspendThread()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_SuspendThread </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__OS__APIS__TYPES.html#ga20167a3cedec6512ccdc030b50ee780b">NATIVE_TID</a>&#160;</td>
          <td class="paramname"><em>td</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Suspends a running thread.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">td</td><td>Thread descriptor</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_NO_ERROR</td><td>If the operation succeeded </td></tr>
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_SUSPEND_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Windows, Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga51d3a3f045f7d12077b92f49274844b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga51d3a3f045f7d12077b92f49274844b9">&#9670;&nbsp;</a></span>OS_ThreadExitAndClear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_ThreadExitAndClear </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>stackAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ADDRINT&#160;</td>
          <td class="paramname"><em>stackSize</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">INT32 *&#160;</td>
          <td class="paramname"><em>dwordToReset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This function clears a word and then exits the calling thread. It guaranteess that it will use only register state (no memory) once <em>word</em> is cleared.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">code</td><td>The thread exit code as passed from the caller </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">dwordToReset</td><td>This memory location is cleared (set to zero).</td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_EXIT_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
<a id="ga4e1358f36d98dff7b62de2f410439787"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4e1358f36d98dff7b62de2f410439787">&#9670;&nbsp;</a></span>OS_Yield()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__OS__APIS__DEF.html#ga8e6b2f5406a922a419991358caae6fc7">OS_RETURN_CODE</a> OS_Yield </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Pre-empts the thread specified by the running thread.</p>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">OS_RETURN_CODE_NO_ERROR</td><td>If the operation succeeded </td></tr>
    <tr><td class="paramname">OS_RETURN_CODE_THREAD_SLEEP_FAILED</td><td>If the operation Failed </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Operation status code.</dd></dl>
<dl class="section user"><dt>Availability:</dt><dd><b>O/S</b>: Windows, Linux &amp; macOS*<br  />
 <b>CPU:</b> All<br  />
</dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
